package com.pdsu.graduation_design.adapter;

import android.content.Context;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.TextView;

import com.pdsu.graduation_design.R;

public class OrderListAdapter extends BaseAdapter {


    public OrderListAdapter(Context context) {
        this.context = context;
    }

    private Context context;
    private String[] commoditys={"potato","tomato"};
    private TextView commodity;
    @Override
    public int getCount() {
        return commoditys.length;
    }

    @Override
    public Object getItem(int position) {
        return commoditys[position];
    }

    @Override
    public long getItemId(int position) {
        return 0;
    }

    @Override
    public View getView(int position, View convertView, ViewGroup parent) {

        View view=View.inflate(context, R.layout.order_list_view_item,null);
        commodity=view.findViewById(R.id.order_listview_item_commodity_name);
        commodity.setText(commoditys[position]);

        return view;
    }
}
